3.1497 \(\int \sec ^4(c+d x) (a+b \sin (c+d x))^2 \tan (c+d x) \, dx\)

Optimal. Leaf size=72 \[ -\frac {\sec ^2(c+d x) \left (a b \sin (c+d x)+b^2\right )}{4 d}-\frac {a b \tanh ^{-1}(\sin (c+d x))}{4 d}+\frac {\sec ^4(c+d x) (a+b \sin (c+d x))^2}{4 d} \]

[Out]

-1/4*a*b*arctanh(sin(d*x+c))/d+1/4*sec(d*x+c)^4*(a+b*sin(d*x+c))^2/d-1/4*sec(d*x+c)^2*(b^2+a*b*sin(d*x+c))/d

________________________________________________________________________________________

Rubi [A]  time = 0.10, antiderivative size = 72, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, integrand size = 27, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.185, Rules used = {2837, 12, 821, 639, 206} \[ -\frac {\sec ^2(c+d x) \left (a b \sin (c+d x)+b^2\right )}{4 d}-\frac {a b \tanh ^{-1}(\sin (c+d x))}{4 d}+\frac {\sec ^4(c+d x) (a+b \sin (c+d x))^2}{4 d} \]

Antiderivative was successfully verified.

[In]

Int[Sec[c + d*x]^4*(a + b*Sin[c + d*x])^2*Tan[c + d*x],x]

[Out]

-(a*b*ArcTanh[Sin[c + d*x]])/(4*d) + (Sec[c + d*x]^4*(a + b*Sin[c + d*x])^2)/(4*d) - (Sec[c + d*x]^2*(b^2 + a*
b*Sin[c + d*x]))/(4*d)

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 639

Int[((d_) + (e_.)*(x_))*((a_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> Simp[((a*e - c*d*x)*(a + c*x^2)^(p + 1))/(2*a
*c*(p + 1)), x] + Dist[(d*(2*p + 3))/(2*a*(p + 1)), Int[(a + c*x^2)^(p + 1), x], x] /; FreeQ[{a, c, d, e}, x]
&& LtQ[p, -1] && NeQ[p, -3/2]

Rule 821

Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))*((a_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> Simp[((d + e*x)^m*
(a + c*x^2)^(p + 1)*(a*g - c*f*x))/(2*a*c*(p + 1)), x] - Dist[1/(2*a*c*(p + 1)), Int[(d + e*x)^(m - 1)*(a + c*
x^2)^(p + 1)*Simp[a*e*g*m - c*d*f*(2*p + 3) - c*e*f*(m + 2*p + 3)*x, x], x], x] /; FreeQ[{a, c, d, e, f, g}, x
] && NeQ[c*d^2 + a*e^2, 0] && LtQ[p, -1] && GtQ[m, 0] && (IntegerQ[m] || IntegerQ[p] || IntegersQ[2*m, 2*p])

Rule 2837

Int[cos[(e_.) + (f_.)*(x_)]^(p_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((c_.) + (d_.)*sin[(e_.) + (f_.)
*(x_)])^(n_.), x_Symbol] :> Dist[1/(b^p*f), Subst[Int[(a + x)^m*(c + (d*x)/b)^n*(b^2 - x^2)^((p - 1)/2), x], x
, b*Sin[e + f*x]], x] /; FreeQ[{a, b, c, d, e, f, m, n}, x] && IntegerQ[(p - 1)/2] && NeQ[a^2 - b^2, 0]

Rubi steps

\begin {align*} \int \sec ^4(c+d x) (a+b \sin (c+d x))^2 \tan (c+d x) \, dx &=\frac {b^5 \operatorname {Subst}\left (\int \frac {x (a+x)^2}{b \left (b^2-x^2\right )^3} \, dx,x,b \sin (c+d x)\right )}{d}\\ &=\frac {b^4 \operatorname {Subst}\left (\int \frac {x (a+x)^2}{\left (b^2-x^2\right )^3} \, dx,x,b \sin (c+d x)\right )}{d}\\ &=\frac {\sec ^4(c+d x) (a+b \sin (c+d x))^2}{4 d}-\frac {b^2 \operatorname {Subst}\left (\int \frac {2 b^2 (a+x)}{\left (b^2-x^2\right )^2} \, dx,x,b \sin (c+d x)\right )}{4 d}\\ &=\frac {\sec ^4(c+d x) (a+b \sin (c+d x))^2}{4 d}-\frac {b^4 \operatorname {Subst}\left (\int \frac {a+x}{\left (b^2-x^2\right )^2} \, dx,x,b \sin (c+d x)\right )}{2 d}\\ &=\frac {\sec ^4(c+d x) (a+b \sin (c+d x))^2}{4 d}-\frac {\sec ^2(c+d x) \left (b^2+a b \sin (c+d x)\right )}{4 d}-\frac {\left (a b^2\right ) \operatorname {Subst}\left (\int \frac {1}{b^2-x^2} \, dx,x,b \sin (c+d x)\right )}{4 d}\\ &=-\frac {a b \tanh ^{-1}(\sin (c+d x))}{4 d}+\frac {\sec ^4(c+d x) (a+b \sin (c+d x))^2}{4 d}-\frac {\sec ^2(c+d x) \left (b^2+a b \sin (c+d x)\right )}{4 d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [B]  time = 2.94, size = 215, normalized size = 2.99 \[ \frac {2 a^4 b^2 \sec ^2(c+d x)+a b \left (a^2-b^2\right )^2 (\log (1-\sin (c+d x))-\log (\sin (c+d x)+1))-2 a b \left (a^2-b^2\right ) \tan (c+d x) \sec (c+d x) \left (a^2+2 b^2 \tan ^2(c+d x)+b^2\right )+2 b^4 \left (b^2-a^2\right ) \tan ^4(c+d x)+b \left (4 a^2 b^3-6 a^4 b\right ) \tan ^2(c+d x)+2 a^4 \left (a^2-b^2\right ) \sec ^4(c+d x)+4 a^3 b \left (a^2-b^2\right ) \tan (c+d x) \sec ^3(c+d x)}{8 d \left (a^2-b^2\right )^2} \]

Antiderivative was successfully verified.

[In]

Integrate[Sec[c + d*x]^4*(a + b*Sin[c + d*x])^2*Tan[c + d*x],x]

[Out]

(a*b*(a^2 - b^2)^2*(Log[1 - Sin[c + d*x]] - Log[1 + Sin[c + d*x]]) + 2*a^4*b^2*Sec[c + d*x]^2 + 2*a^4*(a^2 - b
^2)*Sec[c + d*x]^4 + 4*a^3*b*(a^2 - b^2)*Sec[c + d*x]^3*Tan[c + d*x] + b*(-6*a^4*b + 4*a^2*b^3)*Tan[c + d*x]^2
 + 2*b^4*(-a^2 + b^2)*Tan[c + d*x]^4 - 2*a*b*(a^2 - b^2)*Sec[c + d*x]*Tan[c + d*x]*(a^2 + b^2 + 2*b^2*Tan[c +
d*x]^2))/(8*(a^2 - b^2)^2*d)

________________________________________________________________________________________

fricas [A]  time = 0.44, size = 104, normalized size = 1.44 \[ -\frac {a b \cos \left (d x + c\right )^{4} \log \left (\sin \left (d x + c\right ) + 1\right ) - a b \cos \left (d x + c\right )^{4} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 4 \, b^{2} \cos \left (d x + c\right )^{2} - 2 \, a^{2} - 2 \, b^{2} + 2 \, {\left (a b \cos \left (d x + c\right )^{2} - 2 \, a b\right )} \sin \left (d x + c\right )}{8 \, d \cos \left (d x + c\right )^{4}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^5*sin(d*x+c)*(a+b*sin(d*x+c))^2,x, algorithm="fricas")

[Out]

-1/8*(a*b*cos(d*x + c)^4*log(sin(d*x + c) + 1) - a*b*cos(d*x + c)^4*log(-sin(d*x + c) + 1) + 4*b^2*cos(d*x + c
)^2 - 2*a^2 - 2*b^2 + 2*(a*b*cos(d*x + c)^2 - 2*a*b)*sin(d*x + c))/(d*cos(d*x + c)^4)

________________________________________________________________________________________

giac [A]  time = 0.24, size = 89, normalized size = 1.24 \[ -\frac {a b \log \left ({\left | \sin \left (d x + c\right ) + 1 \right |}\right ) - a b \log \left ({\left | \sin \left (d x + c\right ) - 1 \right |}\right ) - \frac {2 \, {\left (a b \sin \left (d x + c\right )^{3} + 2 \, b^{2} \sin \left (d x + c\right )^{2} + a b \sin \left (d x + c\right ) + a^{2} - b^{2}\right )}}{{\left (\sin \left (d x + c\right )^{2} - 1\right )}^{2}}}{8 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^5*sin(d*x+c)*(a+b*sin(d*x+c))^2,x, algorithm="giac")

[Out]

-1/8*(a*b*log(abs(sin(d*x + c) + 1)) - a*b*log(abs(sin(d*x + c) - 1)) - 2*(a*b*sin(d*x + c)^3 + 2*b^2*sin(d*x
+ c)^2 + a*b*sin(d*x + c) + a^2 - b^2)/(sin(d*x + c)^2 - 1)^2)/d

________________________________________________________________________________________

maple [A]  time = 0.26, size = 122, normalized size = 1.69 \[ \frac {a^{2}}{4 d \cos \left (d x +c \right )^{4}}+\frac {a b \left (\sin ^{3}\left (d x +c \right )\right )}{2 d \cos \left (d x +c \right )^{4}}+\frac {a b \left (\sin ^{3}\left (d x +c \right )\right )}{4 d \cos \left (d x +c \right )^{2}}+\frac {a b \sin \left (d x +c \right )}{4 d}-\frac {a b \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{4 d}+\frac {b^{2} \left (\sin ^{4}\left (d x +c \right )\right )}{4 d \cos \left (d x +c \right )^{4}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(d*x+c)^5*sin(d*x+c)*(a+b*sin(d*x+c))^2,x)

[Out]

1/4/d*a^2/cos(d*x+c)^4+1/2/d*a*b*sin(d*x+c)^3/cos(d*x+c)^4+1/4/d*a*b*sin(d*x+c)^3/cos(d*x+c)^2+1/4*a*b*sin(d*x
+c)/d-1/4/d*a*b*ln(sec(d*x+c)+tan(d*x+c))+1/4/d*b^2*sin(d*x+c)^4/cos(d*x+c)^4

________________________________________________________________________________________

maxima [A]  time = 0.39, size = 97, normalized size = 1.35 \[ -\frac {a b \log \left (\sin \left (d x + c\right ) + 1\right ) - a b \log \left (\sin \left (d x + c\right ) - 1\right ) - \frac {2 \, {\left (a b \sin \left (d x + c\right )^{3} + 2 \, b^{2} \sin \left (d x + c\right )^{2} + a b \sin \left (d x + c\right ) + a^{2} - b^{2}\right )}}{\sin \left (d x + c\right )^{4} - 2 \, \sin \left (d x + c\right )^{2} + 1}}{8 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^5*sin(d*x+c)*(a+b*sin(d*x+c))^2,x, algorithm="maxima")

[Out]

-1/8*(a*b*log(sin(d*x + c) + 1) - a*b*log(sin(d*x + c) - 1) - 2*(a*b*sin(d*x + c)^3 + 2*b^2*sin(d*x + c)^2 + a
*b*sin(d*x + c) + a^2 - b^2)/(sin(d*x + c)^4 - 2*sin(d*x + c)^2 + 1))/d

________________________________________________________________________________________

mupad [B]  time = 18.87, size = 183, normalized size = 2.54 \[ \frac {2\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+2\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+\frac {a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7}{2}+\frac {7\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5}{2}+\frac {7\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{2}+\frac {a\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{2}+4\,b^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8-4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+6\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4-4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}-\frac {a\,b\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{2\,d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((sin(c + d*x)*(a + b*sin(c + d*x))^2)/cos(c + d*x)^5,x)

[Out]

(2*a^2*tan(c/2 + (d*x)/2)^2 + 2*a^2*tan(c/2 + (d*x)/2)^6 + 4*b^2*tan(c/2 + (d*x)/2)^4 + (7*a*b*tan(c/2 + (d*x)
/2)^3)/2 + (7*a*b*tan(c/2 + (d*x)/2)^5)/2 + (a*b*tan(c/2 + (d*x)/2)^7)/2 + (a*b*tan(c/2 + (d*x)/2))/2)/(d*(6*t
an(c/2 + (d*x)/2)^4 - 4*tan(c/2 + (d*x)/2)^2 - 4*tan(c/2 + (d*x)/2)^6 + tan(c/2 + (d*x)/2)^8 + 1)) - (a*b*atan
h(tan(c/2 + (d*x)/2)))/(2*d)

________________________________________________________________________________________

sympy [F(-1)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)**5*sin(d*x+c)*(a+b*sin(d*x+c))**2,x)

[Out]

Timed out

________________________________________________________________________________________